package com.itheima.test;

import java.util.ArrayList;

public class StudentOperatorImpl1 implements StudentOperator{
    @Override
    public void printAll(ArrayList<Student> stus) {
        System.out.println("----------学生全部信息-----------");
        for (Student student : stus) {
            System.out.println(student);
        }
    }

    @Override
    public void printAvgScore(ArrayList<Student> stus) {
        System.out.println("----------学生全部信息-----------");
        Double allScore = 0.0;
        for (Student student : stus) {
            allScore += student.getScore();
        }
        System.out.println(String.format("%.2f",allScore/stus.size()));
    }
}
